//
//  OAAddPeopleVC.m
//  OA项目
//
//  Created by innofive on 2018/4/24.
//  Copyright © 2018年 inno. All rights reserved.
//

#import "OAAddPeopleVC.h"
#import "OAAddressBookHeaderView.h"

@interface OAAddPeopleVC ()

@end

@implementation OAAddPeopleVC

- (void)viewDidLoad {
    [super viewDidLoad];
  
    NSArray *ar= @[@{@"imageName":@"",@"title":@"",},
                   @{@"imageName":@"shoujitobngxul",@"title":@"从手机通讯录导入成员",},
                   @{@"imageName":@"addchengyuan",@"title":@"手动添加成员",}];
    [self.dataArr addObjectsFromArray:ar];
}

-(void)onLoadViewByWillAppear:(UITableView *)view
{
    view.backgroundColor = hexCOLOR(@"F1F1F1");
}

#pragma mark 点击方法
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
    if (indexPath.row==2) {
        
        OAAddVC *vc = [[OAAddVC alloc]init];
        [self presentWindowToVC:vc IsNaV:NO Completion:^{
            
        }];
        
    }
//    OAWebVC *vc =[OAWebVC new];
//    vc.title = @"详情";
//    vc.url = @"http://wwww.baidu.com";
//    [self pushToVC:vc];
}

-(void)onSetSubviewSELForCell:(BaseTableViewCell *)cell forTableView:(UITableView *)tableView forIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row==0) {
        cell.backgroundColor = [UIColor clearColor];
    }
    
}

-(MCCellInfo *)tableView:(UITableView *)tableView cellForIndexPath:(NSIndexPath *)indexPath IsHeight:(BOOL)isheight
{
    if (indexPath.row==0) {
    return [MCCellInfo configForCellId:cell Class:[BaseTableViewCell class] Height:kFitH(10) TableView:tableView];
    }
    return [MCCellInfo configForCellId:cell2 Class:[OAAddressBook5Cell class] Height:kFitH(40) TableView:tableView];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}




@end



@interface OAAddVC ()

@end

@implementation OAAddVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
   
}

-(void)onLoadViewByWillAppear:(UITableView *)view
{
    
   
    UIView *bgView = ({
        UIView *l = [UIView new];
        l.backgroundColor = hexCOLOR(@"EFEFEF");
        l.cornerRadius = 6;
        l.masksToBounds = YES;
        [view addV:l];
        l;
    });
    
    UILabel *label = ({
        UILabel *l = [UILabel new];
        l.textAlignment = NSTextAlignmentCenter;
        l.text = @"添加成员信息";
        l.font = kSysFont(kFitW(14));
        l.textColor = [UIColor blackColor];
        l.hasBottomLine= YES;
        [bgView addV:l];
        l;
    });
    
    HLTextField *textF = ({
        HLTextField *l = [HLTextField new];
        l.placeholder = @"姓名";
        l.hasTopLine = YES;
        l.hasBottomLine = YES;
        l.placeholderInsets = UIEdgeInsetsMake(0, kFitW(15), 0, 0);
        l.placeholderFont = kSysFont(kFitW(12));
        l.backgroundColor = [UIColor whiteColor];
        l.placeholderColor = hexCOLOR(@"999999");
        [bgView addV:l];
        l;
    });
    
    HLTextField *textF1 = ({
        HLTextField *l = [HLTextField new];
        l.placeholder = @"手机号码";
        l.hasBottomLine = YES;
        l.placeholderInsets = UIEdgeInsetsMake(0, kFitW(15), 0, 0);
        l.backgroundColor = [UIColor whiteColor];
        l.placeholderFont = kSysFont(kFitW(12));
        l.placeholderColor = hexCOLOR(@"999999");
        [bgView addV:l];
        l;
    });
    
    
    
    UIButton *btn1 = ({
        UIButton *l = [UIButton buttonWithType:UIButtonTypeCustom];
        [l AddTarget:self Action:@selector(onClickBtn:)];
        [l setNormalTitle:@"添加并发送短信通知"];
        [l setNormalTitleColor:[UIColor whiteColor]];
        l.titleLabel.font = kSysFont(kFitW(12));
        l.backgroundColor = hexCOLOR(@"A77B28");
        l.tag = 20;
        [bgView addV:l];
        l;
    });
    
    
    UIButton *btn = ({
        UIButton *l = [UIButton buttonWithType:UIButtonTypeCustom];
        [l AddTarget:self Action:@selector(onClickBtn:)];
        [l setNormalImage:IMAGE(@"shanc")];
        l.tag = 10;
        [view addV:l];
        l;
    });
    
    
    [self onMainQueueAddSub:^(UIView *view, CGPoint origin, CGSize size, CGPoint center) {
        
        bgView.size = CGSizeMake(size.width-kFitW(80),kFitH(180));
        bgView.centerX = size.width/2;
        bgView.centerY = size.height/2;
        
        [btn sizeToFit];
        btn.right =bgView.right+btn.width/2;;
        btn.top = bgView.top-btn.width/2;;
        
        
        label.frame = CGRectMake(0, 0, bgView.size.width, kFitH(50));
        
        textF.frame = CGRectMake(0,label.height,bgView.size.width,kFitH(40));
        textF1.frame = CGRectMake(0,textF.bottom,bgView.size.width,kFitH(40));
        
        btn1.size = CGSizeMake(bgView.size.width-kFitW(40), kFitH(30));
        btn1.left = kFitW(20);
        btn1.bottom =bgView.size.height-kFitH(10);
        
    }];
            
}

    
    -(void)onClickBtn:(UIButton *)button
    {
        [super onDismissReturn];
    }


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}




@end
